Unit BDojoxTableContainerUnit;

{$mode objfpc}{$H+}

Interface

Uses
  Classes, SysUtils, BDojoSessionUnit, BDijitLayoutWidgetUnit;

Type

{ BDojoxTableContainerClass }

 BDojoxTableContainerClass = Class(BDijitLayoutWidgetClass)
  Private
    bCols: Integer;
    bCustomClass: String;
    bLabelWidth: Integer;
    bOrientation: String;
    bShowLabels: Boolean;
    bSpacing: Integer;
    Procedure SetCols(aValue: Integer);
    Procedure SetCustomClass(aValue: String);
    Procedure SetLabelWidth(aValue: Integer);
    Procedure SetOrientation(aValue: String);
    Procedure SetShowLabels(aValue: Boolean);
    Procedure SetSpacing(aValue: Integer);
  Public
    //**
    //TODO: Add Cols description
    Property Cols: Integer Read bCols Write SetCols;
    //** A CSS class that will be applied to child elements. For example, if the class is "myClass", the table will have "myClass-table" applied to it, each label TD will have "myClass-labelCell" applied, and each widget TD will have "myClass-valueCell" applied.
    Property CustomClass: String Read bCustomClass Write SetCustomClass;
    //** Defines the width of a label. If the value is a number, it is treated as a pixel value. The other valid value is a percentage, e.g. "50%"
    Property LabelWidth: Integer Read bLabelWidth Write SetLabelWidth;
    //** Either "horiz" or "vert" for label orientation.
    Property Orientation: String Read bOrientation Write SetOrientation;
    //** True if labels should be displayed, false otherwise.
    Property ShowLabels: Boolean Read bShowLabels Write SetShowLabels;
    //** The cell spacing to apply to the table.
    Property Spacing: Integer Read bSpacing Write SetSpacing;

    Constructor Build(Const aSession: BDojoSessionClass;
      Const aJSType: String = ''); override;
End;

Implementation

{ BDojoxTableContainerClass }

Procedure BDojoxTableContainerClass.SetCols(aValue: Integer);
Begin
  bCols := aValue;
  SetConfig('cols', aValue);
End;

Procedure BDojoxTableContainerClass.SetCustomClass(aValue: String);
Begin
  bCustomClass := aValue;
  SetConfig('customClass', aValue);
End;

Procedure BDojoxTableContainerClass.SetLabelWidth(aValue: Integer);
Begin
  bLabelWidth := aValue;
  SetConfig('labelWidth', aValue);
End;

Procedure BDojoxTableContainerClass.SetOrientation(aValue: String);
Begin
  bOrientation := aValue;
  SetConfig('orientation', aValue);
End;

Procedure BDojoxTableContainerClass.SetShowLabels(aValue: Boolean);
Begin
  bShowLabels := aValue;
  SetConfig('showLabels', aValue);
End;

Procedure BDojoxTableContainerClass.SetSpacing(aValue: Integer);
Begin
  bSpacing := aValue;
  SetConfig('spacing', aValue);
End;

Constructor BDojoxTableContainerClass.Build(Const aSession: BDojoSessionClass;
  Const aJSType: String);
Begin
  If aJSType = '' Then Inherited Build(aSession, 'dojox.layout.TableContainer')
  Else Inherited Build(aSession, aJSType);
End;

End.

